﻿<?php
	function callWater(){
		require_once("db/connectDB.php");
		$j=3;
		$i=0;
		$result =mysql_query("select * from gericht where id >=100 and id<=113");
		
		while ($row= mysql_fetch_array($result)){
			if($i==0 ||$i==$j){
				if($i==$j) {
					$j=3+$j;
				}
				echo "<div class= 'row'>";
				echo "<div class= 'col-xs-6 col-md-4'>";
				echo "<w id = ".$row['id']." type= 'button' class='btn btn-danger btn-lg btn-block' style ='font-size: 15px;'>".$row['named']."</w>";
				echo "</div>";
				$i++;
			}
			else{
				echo "<div class= 'col-xs-6 col-md-4'>";
				echo "<w id = ".$row['id'] ." type= 'button' class='btn btn-danger btn-lg btn-block' style ='font-size: 15px;'>".$row['named']."</w>";
				echo "</div>";
				if($i==($j-1)){
					echo "</div>";
					echo "<br>";
				}
				$i++;
			} 
		}
		mysql_free_result($result);	
	}

	function callSoft(){
		require_once("db/connectDB.php");
		$j=3;
		$i=0;
		$result =mysql_query("select * from gericht where id >=114 and id<=125");
		while ($row= mysql_fetch_array($result)){
			if($i==0 ||$i==$j){
				if($i==$j) {
					$j=3+$j;
				}
				echo "<div class= 'row'>";
				echo "<div class= 'col-xs-6 col-md-4'>";
				echo "<so id = ".$row['id']." type= 'button' class='btn btn-danger btn-lg btn-block' style ='font-size: 15px;'>".$row['named']."</so>";
				echo "</div>";
				$i++;
			}
			else{
				echo "<div class= 'col-xs-6 col-md-4'>";
				echo "<so id = ".$row['id'] ." type= 'button' class='btn btn-danger btn-lg btn-block' style ='font-size: 15px;'>".$row['named']."</so>";
				echo "</div>";
				if($i==($j-1)){
					echo "</div>";
					echo "<br>";
				}
				$i++;
			} 
		}
		mysql_free_result($result);	
	}

	function callApe(){
		require_once("db/connectDB.php");
		$j=3;
		$i=0;
		$result =mysql_query("select * from gericht where id >=1 and id<=20");
		while ($row= mysql_fetch_array($result)){
			if($i==0 ||$i==$j){
				if($i==$j) {
					$j=3+$j;
				}
				echo "<div class= 'row'>";
				echo "<div class= 'col-xs-6 col-md-4'>";
				echo "<ape id = ".$row['id']." type= 'button' class='btn btn-danger btn-lg btn-block' style ='font-size: 15px;'>".$row['named']."</ape>";
				echo "</div>";
				$i++;
			}
			else{
				echo "<div class= 'col-xs-6 col-md-4'>";
				echo "<ape id = ".$row['id'] ." type= 'button' class='btn btn-danger btn-lg btn-block' style ='font-size: 15px;'>".$row['named']."</ape>";
				echo "</div>";
				if($i==($j-1)){
					echo "</div>";
					echo "<br>";
				}
				$i++;
			} 
		}
		mysql_free_result($result);	
	}
?>